package com.example.actionsignin.http;

import com.example.actionsignin.constant.Url;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;

/**
 * Created by 旭 on 2017/11/15/015.
 */

public class FaceHttpUtil {

    private static FaceApiService faceApiServer;

    public static FaceApiService sendFace()
    {
        if (faceApiServer == null)
        {
            faceApiServer = new Retrofit.Builder()
                    .addConverterFactory(ScalarsConverterFactory.create())
                    .addConverterFactory(GsonConverterFactory.create())
                    .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                    .baseUrl(Url.FACE_URL)
                    .build()
                    .create(FaceApiService.class);
        }

        return faceApiServer;
    }
}
